package gsjob

import (
	"github.com/robfig/cron/v3"
	"sync"

	"gitee.com/crack007/goose/gslog"
)

var schedule *cron.Cron
var initCron = sync.Once{}
var initCronStatus = false

func Register() {
	initCron.Do(func() {
		gslog.Trace("init job service!")
		schedule = cron.New()
		go schedule.Run()
		initCronStatus = true
	})
}
